package com.yyk.yiliao.bean;

import com.contrarywind.interfaces.IPickerViewData;

import java.util.List;

/**
 * Created by ${zk} on 2018/8/18 0018.
 * 必须实现 IPickerViewData
 * <p>
 *使用JDBC获取数据库数据，并生成json格式文件（省市区三级联动） - CSDN博客  https://blog.csdn.net/qq_31332467/article/details/79016562
 */
public class JsonBean implements IPickerViewData {
    /**
     * name : 省份
     * city : [{"name":"北京市","area":["东城区","西城区","崇文区","宣武区","朝阳区"]}]
     */

    private String name;
    private int name_id;
    private List<CityBean> city;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getName_id() {
        return name_id;
    }

    public void setName_id(int name_id) {
        this.name_id = name_id;

    }


    public List<CityBean> getCityList() {
        return city;
    }

    public void setCityList(List<CityBean> city) {
        this.city = city;
    }

    // 实现 IPickerViewData 接口，
    // 这个用来显示在PickerView上面的字符串，
    // PickerView会通过IPickerViewData获取getPickerViewText方法显示出来。
    @Override
    public String getPickerViewText() {
        return this.name;
    }


    public static class CityBean {
        /**
         * name : 城市
         * area : ["东城区","西城区","崇文区","昌平区"]
         */

        private String name;
        private int name_id;
        private List<String> area;
        private List<String> area_id;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getName_id() {
            return name_id;
        }

        public void setName_id(int name_id) {
            this.name_id = name_id;
        }

        public List<String> getArea_id() {
            return area_id;
        }

        public void setArea_id(List<String> area_id) {
            this.area_id = area_id;
        }

        public List<String> getArea() {
            return area;
        }

        public void setArea(List<String> area) {
            this.area = area;
        }
    }
}